import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/*class  Mypool
{
    private BlockingQueue<Runnable>a=new LinkedBlockingQueue<>();
    public Mypool(int n)
    {
        for(int i=0;i<n;i++)
        {
            Thread t1=new Thread(()->{
                while(true)
                {
                    try {
                        Runnable task = a.take();
                        task.run();
                    }catch(InterruptedException e)
                    {
                        e.printStackTrace();
                    }

                }


            });
            t1.start();
        }
    }
    public void put(Runnable runnable)
    {
        try {
            a.put(runnable);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}


public class Mythread28 {
    public static void main(String[] args) {
       Mypool executorService=new Mypool(10);
        for(int i=0;i<1000;i++)
        {
            int cur=i;
            executorService.put(new Runnable() {
                @Override
                public void run() {
                    System.out.println(cur);

                }
            });
        }

    }



}

 */


